
function MFArefreshInfo (refreshOK) {
   var info = localStorage.getItem ('po_mfa_alerts');
   if (!info) info = "<div><b><span class='nobreak'></span></b></div>";
   if (refreshOK==null) refreshOK=true;

   var div = document.createElement ("div");
   div.innerHTML = info;
   var lnk = document.createElement ("span");
   var lnkText = (refreshOK==true)?"...":"[server error...]";
   lnk.innerHTML = "<a id='po_mfa_refresh_link' href='javascript:MFArequestRefresh();void(0)'>"+lnkText+"</a>";
   div.firstChild.appendChild (lnk.firstChild);
   var tds = document.getElementsByTagName ("td");
   var td = tds[tds.length - 1];

   var ex = document.getElementById("po_mfa_info_text");
   if (ex) ex.parentNode.removeChild (ex);
   td.innerHTML += div.innerHTML;
   
   setTimeout ("MFArefreshInfo", 60000); // Refresh every minute 
   //POlog ("po_mfa: Refreshing info");
}

function MFArequestRefresh () {
   var lnk = document.getElementById ("po_mfa_refresh_link");
   if (lnk) lnk.textContent = "checking...";
   top.po_mfa_refresh (true, MFArefreshInfo);
}

MFArefreshInfo ();
